package tgc.edu.yzy.repository;

import java.util.List;

import javax.transaction.Transactional;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import tgc.edu.yzy.custom.CommonRepository;
import tgc.edu.yzy.entity.Student;
@Repository
public interface StudentRepository extends CommonRepository<Student, Integer>{

	public Student findBySnAndPassword(String username, String password);

	public List<Student> findByGradeId(Integer id);
	
	public List<Student> findByBjId(Integer id);

	@Modifying
	@Query(value="update Student t set t.password=?1 WHERE t.id=?2")
	public void updatePassword(String password, Integer id);

	public Page<Student> findByBjId(Integer bjid, Pageable pageable);
	
	

	
	
	

}
